package com.kun.statistics.controller;

import com.kun.common.utils.R;
import com.kun.statistics.feign.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/statistics")
@RestController
public class StatisticsController {
    @Autowired
    OrderFeignService orderFeignService;
    @GetMapping("/getCountPayType")
    public R getCountPayType(){
        R countPayType = orderFeignService.getCountPayType();
        return R.ok().put("data",countPayType.get("data"));
    }
    @GetMapping("/getMonthSaleByYear")
    public R getMonthSaleByYear(@RequestParam String year){
        R monthSaleByYear = orderFeignService.getMonthSaleByYear(year);
        return R.ok().put("data",monthSaleByYear.get("data"));
    }
}
